export const initState = {
    user: {
        phone:"",
        nickname:"",
        password:"",
    }
}

export const reducer = (state, action) => {
    switch (action.type) {
        case "changeUser":
            return{
                ...state,
                user:{
                    ...state.user,
                    [action.key]:action.value
                }
            }
        default:
            return state
    }
}

export const actions = {
    changeUser:(key,value)=>({type:"changeUser",key,value}),
}